import Show from "@/component/Show";
import styles from "./style.module.less";

export namespace ExplorerItemView {
  export interface Props extends React.HTMLAttributes<HTMLDivElement> {
    icon?: React.ReactNode;
    tail?: React.ReactNode;
  }
}
export function ExplorerItemView(props: ExplorerItemView.Props) {
  const { icon, tail, children, ..._p } = props;
  return (
    <div {..._p} className={styles.explorer_item_view}>
      <Show.Span yes={!!icon}>{icon}</Show.Span>
      <span className={styles.text}>{children}</span>
      <Show.Span yes={!!tail}>{tail}</Show.Span>
    </div>
  )
}